package com.weixin.base.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;

import com.weixin.base.dao.RoleDao;
import com.weixin.base.service.RoleService;
import com.weixin.entity.BgRight;
@Service("roleService")
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleDao roleDao;
	
	public void addRole(BgRight bgright) {
		roleDao.save(bgright);
	}
	
	public Page findByPageRequest(PageRequest<Map> pageRequest) {
		return roleDao.findByPageRequest(pageRequest);
	}
	
	public void upRole(BgRight bgright){
		roleDao.update(bgright);
	}
	
	public void deleteRoleById(int ids){
		roleDao.delById(ids);
	}
	
	public Map<String,Object> selRolePermiss(int nRoleId){
		return roleDao.selRolePermiss(nRoleId);
	}

	public void upDelRolePermiss(int nRoleId,String nNavTrees){
		roleDao.upDelRolePermiss(nRoleId, nNavTrees);
	}
	
	public List<Map<String,Object>> selectRoleMPermiss(int nRoleId){
		return roleDao.selectRoleMPermiss(nRoleId);
	}
	
	public void updateRoleMPermiss(int nRoleId,String permissRws){
		roleDao.updateRoleMPermiss(nRoleId, permissRws);
	}
	
}
